<template>
  <div :class="[`nav-title-${props.type}`]">
    <div>{{ props.title }}</div>
    <slot name="extra"></slot>
    <div class="right-icon" v-if="props.showRightIcon">
      <DoubleRightOutlined />
    </div>
    <slot></slot>
  </div>
</template>
<script lang="ts" setup>
import { DoubleRightOutlined } from '@ant-design/icons-vue';
const props = defineProps({
  title: {
    type: String,
    default: () => '默认头部',
  },
  showRightIcon: {
    type: Boolean,
    default: () => false,
  },
  type: {
    type: String,
    default: () => 'default',
  },
});
</script>

<style lang="less" scoped>
.nav-title-default {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background-color: #eef7ff;
  font-size: 18px;
  height: 34px;
  border-radius: 4px;
  font-weight: 600;
  position: relative;
  &::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 16px;
    background-color: #1890ff;
    margin: 0 10px;
    border-radius: 2px;
  }
  .right-icon {
    position: absolute;
    right: 8px;
    font-size: 16px;
    transform: rotate(90deg);
    color: #2590ff;
  }
}

.nav-title-custom {
}
</style>
